import { reqGetBanners,reqGetFloors } from "@/api"


export default {
    namespaced: true,
   state:{
      banners:[],
      floors:[]
   },
   actions:{
       async getBanners({commit}){
           //请求banner的图片数据
           const resoult =await reqGetBanners()
           commit("GET_BANNERS",resoult)
       },
       async getFloors({commit}){
        //请求Floors的图片数据
        const resoult =await reqGetFloors()
        
        commit("GET_FLOORS",resoult)
    }
   },
   mutations:{
       GET_BANNERS(state, banners){
           //拿到数据，操作状态
           state.banners = banners
       },
       GET_FLOORS(state, floors){
        state.floors = floors
       }
   },
}